home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
kermit.columbia.edu
/
kermit.columbia.edu.tar
/
kermit.columbia.edu
/
newsgroups
/
misc.20010921-20020314
/
000079_fdc@watsun.cc.columbia.edu_Fri Oct 26 16:38:23 EDT 2001.msg
< prev
next >
Wrap
Text File
|
2002-03-13
|
3KB
|
84 lines
Article: 12893 of comp.protocols.kermit.misc
Path: newsmaster.cc.columbia.edu!watsun.cc.columbia.edu!fdc
From: fdc@watsun.cc.columbia.edu (Frank da Cruz)
Newsgroups: comp.unix.aix,comp.protocols.kermit.misc
Subject: Re: rm files found by find command in script
Date: 26 Oct 2001 20:35:55 GMT
Organization: Columbia University
Lines: 67
Message-ID: <9rchfb$h0v$1@newsmaster.cc.columbia.edu>
References: <37ffcf4.0110242123.e886cea@posting.google.com> <3BD805A9.8FA3314D@nogui.se> <3BD94D6B.8FD50FFD@sql.de> <3BD9D979.6A24ED2E@nogui.se>
NNTP-Posting-Host: watsun.cc.columbia.edu
X-Trace: newsmaster.cc.columbia.edu 1004128555 17439 128.59.39.2 (26 Oct 2001 20:35:55 GMT)
X-Complaints-To: postmaster@columbia.edu
NNTP-Posting-Date: 26 Oct 2001 20:35:55 GMT
Xref: newsmaster.cc.columbia.edu comp.unix.aix:224957 comp.protocols.kermit.misc:12893
In article <3BD9D979.6A24ED2E@nogui.se>, Christer Palm <palm@nogui.se> wrote:
: Joerg Bruehe wrote:
: > I do put my foot down and do not allow Microsoft style "names"
: > (like "Own Programs" etc.) in any Unix tool (script) I write.
: > I see no reason why such names should be used, all they bring
: > you is additional difficulties (which fits their MS origin).
:
: I was primarly thinking about the security implications and the risk for
: nasty surprises when using xargs together with destructive commands such
: as rm. Using it with unknown input data by putting it inside an
: automated script, or using it on large sets of files (which I assume was
: the intention of the original poster) is definitely risky.
:
: This can hardly be avoided by simply setting up a policy.
:
Excellent points.
: It is quite clear that spaces, newlines, asterisks and everything else
: except for '\0' and '/' are perfectly valid in UNIX filenames, and that
: they are so by deliberate design. It is also quite clear that it is
: extremely hard to write shell scripts that flawlessly handle those
: characters. Especially when processing a list of filenames.
:
Which is why, sometimes the Unix building-block approach is not ideal,
and the monolithic do-all application can offer bit more utility and
safety. Again, here's C-Kermit 8.0:
http://www.columbia.edu/kermit/ck80.html
First let's list the files in the current directory:
C-Kermit>dir
-rw-rw---- 833 2001-10-26 16:27:12 *.*
-rw-rw---- 1511 2001-10-26 16:27:27 -f
-rw-rw---- 6263 2001-10-26 16:25:58 oofa.txt
-rw-rw---- 2277 2001-10-26 16:26:16 this file
-rw-rw---- 3065 2001-10-26 16:26:34 this is a file too
Yikes, they have funny names. What would happen if I tried to delete
them?
C-Kermit>del /sim *
*.* (SELECTED)
-f (SELECTED)
oofa.txt (SELECTED)
this file (SELECTED)
this is a file too (SELECTED)
It says it would do the right thing. Will it really?
C-Kermit>del /list *
*.* (OK)
-f (OK)
oofa.txt (OK)
this file (OK)
this is a file too (OK)
Yes. checking:
C-Kermit>dir
C-Kermit>
The files are gone. No confusion over the boundaries between filenames,
files whose names contain metacharacters or resemble rm options, etc, and
no obscure syntax was required.
- Frank